package com.h.ops.config;

import com.h.ops.constant.Constants;
import org.springframework.amqp.core.Queue;
import org.springframework.amqp.core.QueueBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

@Configuration
public class RabbitMQConfig {

    // 集群的队列需要使用 quorum()
    @Bean("quorumQueue")
    public Queue quorumQueue() {
        return QueueBuilder.durable(Constants.QUORUM_QUEUE).quorum().build();
    }

    @Bean("clusterQueue")
    public Queue clusterQueue() {
        return QueueBuilder.durable(Constants.CLUSTER_QUEUE).quorum().build();
    }
}
